package com.baidu.ueditor.upload;

import java.io.FileNotFoundException;
import java.io.InputStream;

import com.aliyun.oss.OSSClient;

public class UploadOSSUtil {
	public static void uploadImgAliyun(InputStream inputStream, String fileName) throws FileNotFoundException {
		String accesskeyId = "LTAI2xG5yR6ZjHNO";
		String accessKeySecret = "jdBZ5s0pkehLx8q7ZockFH0NMl1nNW";
		String endpoint = "http://oss-cn-beijing.aliyuncs.com";
		String bucketName = "arri-bucket-2";
		
		OSSClient client = new OSSClient(endpoint, accesskeyId, accessKeySecret);
		// 此处"xxxx/yyyy/"+fileName,表示上传至阿里云中xxxx文件夹下的yyyy文件夹中，请修改为自己的路径即可
		client.putObject(bucketName, "production/ueditor/" + fileName, inputStream);
		client.shutdown();
	}
}
